/*
 * Copyright (C) 2015-2016  Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */


#ifndef PLANET_WARS_2D_RT_CORE_MODEL_SHIP_ESSENTIAL_H
#define PLANET_WARS_2D_RT_CORE_MODEL_SHIP_ESSENTIAL_H


#include "PlanetWars2dRT-core/utils/position_2d_uint.h"
#include "PlanetWars2dRT-core/utils/position_2d_float.h"
#include "PlanetWars2dRT-core/utils/size_2d_uint.h"
#include "PlanetWars2dRT-core/utils/compiler_specific.h"
#include "PlanetWars2dRT-core/utils/observers.h"


struct ship_t
{
  position_2d_float position_current;
  position_2d_uint  position_to_go;
  unsigned int moving_vector;
  size_2d_uint size;
  
  unsigned int power;
  unsigned int life_current, life_max;
  
  unsigned char player_index;
  
  observers_t observers;
};

typedef struct ship_t ship_t;


EXTERN_C_BEGIN


/* other */

static inline
unsigned char
ship_get_player_index(const ship_t* a_ship)
{
  return a_ship->player_index;
}

void
ship_destructor(ship_t* a_ship);


EXTERN_C_END


#endif
